package com.itheima.service.impl;

import com.itheima.dao.OrderDao;
import com.itheima.dao.UserDao;
import com.itheima.pojo.User;
import com.itheima.service.UserService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Component;
import org.springframework.stereotype.Service;

/**
 * @author huyoufu <https://github.com/huyoufu>
 * @TIME 2020-08-07 08:58
 * @description
 */

@Service
public class UserServiceImpl implements UserService {
    @Autowired
    private UserDao userDao;


    @Override
    public User login(String username, String password) {

        System.out.println("模拟service根据用户名和密码查询....");
        return userDao.findByUP(username, password);
    }

    @Override
    public User findById(int id) {
        //int i=5/0;
        System.out.println("模拟service根据id查询....");
        return userDao.findById(id);
    }
}
